link rel="stylesheet" href="__PUBLIC__/static/whoCare/css/login.css">
<div class="model-box layui-form layui-form-pane layui-hide" id="userLogin">
    <div class="box">
        <div class="c">
            <div class="title">
                用户登录
                <span class="cls">+</span>
            </div>
            <div class="cont">
                <!--登录表单-->
                <form action="{:U('Home/index/login')}" method="post" id="loginForm">
                    <div class="l">
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <i class="fa fa-user-o" style="color:#555555;"></i>
                            </label>
                            <div class="layui-input-block">
                                <input type="text" name="user_name" lay-vertype="tips" class="layui-input" placeholder="请输入登录名" lay-verify="username">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <i class="fa fa-key fa-fw" style="color: #555555;"></i>
                            </label>
                            <div class="layui-input-block">
                                <input type="password" name="user_pwd" lay-vertype="tips" class="layui-input" placeholder="请输入密码" lay-verify="password">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <i class="fa fa-lock" style="color: #555555;"></i>
                            </label>
                            <div class="layui-input-block">
                                <input type="text" name="verify" lay-vertype="tips" class="layui-input yzmi" placeholder="请输入验证码" lay-verify="vertify">
                                <img class="yzmi-btn" style="cursor:pointer;" onclick="this.src+='/'+Math.random();" src="{:U('Home/index/showVerify')}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <button class="layui-btn layui-btn-fluid loginBtn" lay-submit="" lay-filter="login">立即登录</button>
                        </div>
                    </div>
                </form>
                <script>
                    $(".loginBtn").click(function () {
                        var data=$("#loginForm").serialize();
                        var href=$("#loginForm").attr("action");
                        $.post(href,data,function (res) {
                            if(res.status==1){
                                layer.msg(res.info);
                                location.reload();
                            }
                            else{
                                layer.msg(res.info);
                            }
                        });
                        return false;
                    });
                </script>
                <div class="r">
                    <div class="layui-form-mid layui-word-aux">还没有账号？</div>
                    <a href="javascript:;" class="layui-btn layui-btn-fluid userRegBtn">立即注册</a>
                </div>
            </div>
        </div>
    </div>
</div>
<script>

</script>



<div class="model-box layui-form layui-form-pane layui-hide" id="userReg">
    <div class="box">
        <div class="c">
            <div class="title">
                用户登录
                <span class="cls">+</span>
            </div>
            <div class="cont">
                <!--注册表单-->
                <form action="{:U('Home/index/addUser')}" method="post" id="addForm">
                    <div class="l">
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <i class="fa fa-user-o" style="color:#555555;"></i>
                            </label>
                            <div class="layui-input-block">
                                <input type="text" name="user_name" lay-vertype="tips" class="layui-input" placeholder="请输入登录名" lay-verify="username">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <i class="fa fa-eyedropper" style="color: #555555;"></i>
                            </label>
                            <div class="layui-input-block">
                                <input type="text" name="user_nickname" lay-vertype="tips" class="layui-input" placeholder="请输入昵称" lay-verify="nickname">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <i class="fa fa-key fa-fw" style="color: #555555;"></i>
                            </label>
                            <div class="layui-input-block">
                                <input type="password" name="user_pwd" lay-vertype="tips" class="layui-input" placeholder="请输入密码" lay-verify="password">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <i class="fa fa-lock" style="color: #555555;"></i>
                            </label>
                            <div class="layui-input-block">
                                <input type="text" name="verify" lay-vertype="tips" class="layui-input yzmi" placeholder="请输入验证码" lay-verify="vertify">
                                <img class="yzmi-btn" style="cursor:pointer;" onclick="this.src+='/'+Math.random();" src="{:U('Home/index/showVerify')}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <button class="layui-btn layui-btn-fluid addBtn" lay-submit="" lay-filter="login">立即注册</button>
                        </div>
                    </div>
                </form>
                <div class="r">
                    <div class="layui-form-mid layui-word-aux">还没有账号？</div>
                    <a href="javascript:;" class="layui-btn layui-btn-fluid userLoginBtn">立即登录</a>
                </div>
            </div>
            <script>
                $(".addBtn").click(function () {
                    var data=$("#addForm").serialize();
                    var href=$("#addForm").attr("action");
                    $.post(href,data,function (res) {
                        if(res.status==1){
                            layer.msg(res.info);
                            $("#userLogin").removeClass('layui-hide');
                            $("#userReg").addClass('layui-hide');
                        }
                        else{
                            layer.msg(res.info);
                        }
                    });
                    return false;
                });
            </script>
        </div>
    </div>
</div>